﻿#------------------------------------------------------------------------------
# Makefile:	说明这个Makefile主要功能
# Author:	作者是谁
#------------------------------------------------------------------------------

TOP_DIR := $(shell pwd)

GOBUILD ?=

ifeq ($(PLATFORM), arm64)
	GOBUILD := GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC=/opt/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc CXX=/opt/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ AR=/opt/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-ar
	CC := /opt/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc
else
	GOBUILD := CC=gcc CXX=g++
	CC := gcc
endif
export CC

SRCS		:=	main.go

#---------------------------------编译规则-------------------------------------

main_dir:
	$(GOBUILD) go build $(SRCS)

.PHONY: clean main_dir

clean:
	-rm -f ./main
